let instance
export default class Databus{
    constructor(){
        if (instance) return instance
        instance = this 
        // 存储公用变量 画布和画布的上下文
        this.canvas
        this.ctx
        this.imgObj = {}
        this.load = false
        this.speed = 2
        this.actors = []
        this.bird
        this.scene = 0
        this.score = 0
        this.max = 0
    }
    // 添加演员方法
    addActor(actor){
        this.actors.push(actor)
    }
    reset(){
        this.actors = []
        this.bird = null
        this.scene = 0
        this.speed = 2
        this.score = 0
    }
    
}